package 上课代码;

import 上课代码.BinaryTree;

public class Teat {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.CreatTree();
        //System.out.println(root.val);

        //前序遍历
        binaryTree.preOrder(root);
        System.out.println();
        //中序遍历
        binaryTree.inOrder(root);
        System.out.println();
        //后序遍历
        binaryTree.postOrder(root);
        System.out.println();
        //结点个数
        System.out.println(binaryTree.size(root));
        System.out.println(binaryTree.getLevelNodeCount(root,3));

        //求最大高度
        System.out.println(binaryTree.getHeight(root));
        //System.out.println(binaryTree.getHeight1(root));
    }
}
